package com.lsy.weizhi2.utils;

/**
 * Created by 嗨哟 on 2017/6/5.
 */

public class MathHelper {
    //保留n位小数：自己封装方法，策略是先乘以10的n次方，取整后转化为浮点数，再除以10的n次方
    public static double SplitAndRound(double a, int n) {
        a = a * Math.pow(10, n);
        return (Math.round(a)) / (Math.pow(10, n));
    }
}
